package com.briup.jdk8;

import java.util.Arrays;
import java.util.List;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * 通过数据产生 stream
 */

public class MakeStream {
    public static void main(String[] args) {
        //通过数值  借助于数组工具类
        Stream<Integer> stream = Stream.of(1, 2, 36, 55, 51, 454, 45);
        //通过数组  使用数组工具类完成构建
        String[] s={"海鹏","海螺","海星","海燕","海绵宝宝"};
        Stream<String> stream1 = Arrays.stream(s);
        //通过集合
        List<String> list = Arrays.asList("熊大", "熊二", "翠花", "光头强", "李老板", "吉吉国王-艳超");
        Stream<String> stream2 = list.stream();
        //基本数据类型的stream操作
        IntStream intStream = IntStream.of(1, 2, 11, 22, 33, 15, 16, 16);
        DoubleStream doubleStream = DoubleStream.of(23.0, 13.25, 850.12, 55.142, 3.14159);
    }
}
